package com.example.controller;

import com.example.entity.User;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

/**
 * Created by admin on 2018/6/4.
 */
@Controller
@ApiIgnore
public class TestController {

    @RequestMapping("/index")
    public String index() {
       return "index";
    }


    @RequestMapping("/hello")
    public String hello(User user) throws Exception {
        throw new Exception("发生错误");
    }

    @RequestMapping("/json")
    public String json() throws MyException {
        throw new MyException("hello 123 world");
    }

    @RequestMapping(value="/data", method= RequestMethod.GET)
    public String testJenkins() {
        return "java==";
    }

}
